package com.crm.business.crm.mapper;


import com.crm.common.crm.entity.BO.CrmRoiSearchBO;
import com.crm.common.crm.entity.PO.CrmAllianceBusinessBalance;
import com.crm.business.servlet.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 加盟商充值表 Mapper 接口
 * </p>
 *
 * @author zhangzhiwei
 * @since 2020-05-26
 */
public interface CrmAllianceBusinessBalanceMapper extends BaseMapper<CrmAllianceBusinessBalance> {


    List<CrmAllianceBusinessBalance> queryPageList(@Param("data") CrmRoiSearchBO search);

    /**
     * 根据组织Id查询充值信息
     * @param deptId
     * @return
     */
    CrmAllianceBusinessBalance queryDataByDeptId(@Param("deptId") Integer deptId, @Param("source") String source);

    BigDecimal queryBalanceByDeptIds(@Param("deptIds") List<Integer> deptIds);

    void updateBalanceByDeptId(@Param("deptId") Integer deptId, @Param("balance") BigDecimal balance);
}
